import home from "@/components/home"
import about from "@/components/about"
import hello from "@/components/introduce/hello"
import watcher from "@/components/introduce/watcher"
import ifelse from "@/components/introduce/ifelse"
import for_ from "@/components/introduce/for"
import event from "@/components/introduce/event"
import router_ from "@/components/router/main"
import router_age from "@/components/router/arg"
import component_ from "@/components/component/component"
import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter);

const routes = [
    {
        path:"*",
        redirect: "/home",
    },
    { path: '/introduce/hello', component: hello },
    { path: '/introduce/watcher', component: watcher },
    { path: '/introduce/ifelse', component: ifelse },
    { path: '/introduce/for', component: for_ },
    { path: '/introduce/event', component: event },
    { path: '/component', component: component_ },
    { path: '/router/main', component: router_ },
    { path: '/router/age', name: "age", component: router_age },
    { path: '/home', component: home },
    { path: '/about', component: about }
]

const router = new VueRouter({
    mode: "history",
    routes // routes: routes 的简写
})

export default router;
